#ifndef GCS_CHECK_HPP
#define GCS_CHECK_HPP

#include <uORB/topics/a05_gcscheck.h>

class MavlinkStreamGcsCheck : public MavlinkStream
{
public:
	static MavlinkStream *new_instance(Mavlink *mavlink) { return new MavlinkStreamGcsCheck(mavlink); }

	static constexpr const char *get_name_static() { return "GCS_CHECK"; }
	static constexpr uint16_t get_id_static() { return MAVLINK_MSG_ID_GCS_CHECK; }

	const char *get_name() const override { return get_name_static(); }
	uint16_t get_id() override { return get_id_static(); }

	unsigned get_size() override
	{
		return _a05_gcscheck_sub.advertised() ? MAVLINK_MSG_ID_GCS_CHECK_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES : 0;
	}

private:
	explicit MavlinkStreamGcsCheck(Mavlink *mavlink) : MavlinkStream(mavlink) {}

	uORB::Subscription _a05_gcscheck_sub{ORB_ID(a05_gcscheck)};

	bool send() override
	{
		a05_gcscheck_s _a05_gcscheck;

		if (_a05_gcscheck_sub.update(&_a05_gcscheck)) {
			mavlink_gcs_check_t msg{};

//			msg.time_usec = _a05_gcscheck.timestamp;

			msg.tx = _a05_gcscheck.tx;
			

			mavlink_msg_gcs_check_send_struct(_mavlink->get_channel(), &msg);

			return true;
		}

		return false;
	}
};

#endif // WIND_COV
